public class Solutiont{
    public static int countCharacterOccurrences(String str, char ch){
        int count = 0;
        for (char c : str.toCharArray()) {
            if (c == ch) {
                count++;
            }
        }
        return count;
    }
    public static void main(String[] var0){

        String str = var0[0] ;
        char ch = var0[1].charAt(0) ;
        Solutiont var3 = new Solutiont();
        System.out.println(var3.countCharacterOccurrences(str, ch));
    }
}